<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="base::header">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body class="smoke-container">
<div style="margin: 10px; background-color: white">
    <div style="display: flex;
          flex-flow: row nowrap;align-items: center;">
        <div>
            <button type="button" class="layui-btn" id="add_button_id">新增</button>
            <button type="button" class="layui-btn" id="update_button_id">编辑</button>
            <button type="button" class="layui-btn" id="delete_button_id">删除</button>
            <button type="button" class="layui-btn" id="users_button_id">管理用户</button>
            <button type="button" class="layui-btn" id="menus_button_id">管理菜单</button>
        </div>
        <div class="layui-form" action="" style="margin-left: 10px">
            <div class="layui-form-item vertical-center">
                <div class="layui-inline">
                    <input type="text" name="keyword" placeholder="关键字" id="keyword_input_id"
                           class="layui-input" th:value="${param.keyword?:''}">
                </div>
                <div class="layui-inline">
                    <button type="button" class="layui-btn" lay-submit lay-filter="search_button_filter">查询</button>
                </div>
            </div>
        </div>
    </div>
    <div style="margin: 10px;" id="role_table_id"></div>
</div>

<script type="text/html" id="enabledTemplate">
    {{#
    var checked = d.enabled === true ? 'checked' : '';
    }}

    <form class="layui-form">
        <div class="layui-form-item">
            <div>
                <input type="checkbox" name="enabled" {{ checked }} lay-skin="switch" data-id="{{d.id}}"
                       lay-text="启用|禁用">
            </div>
        </div>
    </form>
</script>
<script type="text/html" id="opTemplate">
<!--    <button type="button" class="layui-btn layui-btn-xs update-role-class" data-id="{{d.id}}">编辑</button>-->
<!--    <button type="button" class="layui-btn layui-btn-xs delete-role-class" data-id="{{d.id}}">删除</button>-->
    <button type="button" class="layui-btn layui-btn-xs manager-roleUser-class" data-id="{{d.id}}" data-name="{{d.name}}">用户</button>
    <button type="button" class="layui-btn layui-btn-xs manager-roleMenu-class" data-id="{{d.id}}" data-name="{{d.name}}">菜单</button>
</script>

<script th:src="@{/js/admin/role.js}"></script>
</body>
</html>